<template>
  <div>
    <a-card>
      <a-row style="margin-bottom: 10px">
        <a-col :span="24"  style="display: flex;flex-direction: row-reverse">
          <a-button v-print="'#printReport'" type="primary">打印报表</a-button>
        </a-col>
      </a-row>
      <div id="printReport">
        <table border="1" cellpadding="4" cellspacing="0" bordercolor="#000" style="width: 100%">
          <tr>
            <th colspan="33">
              <div style="position: relative;text-align: center">
                <span>{{reportData.title}}</span>
              </div>
            </th>
          </tr>
          <tr>
            <td></td>
            <td>文件编号：{{ reportData.documentNumber }}</td>
            <td colspan="31">日期：{{ reportData.datePurchase }}</td>
          </tr>
          <tr v-if="reportData.dayCheckName.length > 0">
            <td>序号</td>
            <td>点检项目</td>
            <td v-for="i in 31">{{ i }}</td>
          </tr>
          <tr v-for="(item,index) in reportData.dayCheckName" v-if="reportData.dayCheckName.length > 0">
            <td>{{index + 1}}</td>
            <td>{{item}}</td>
            <td v-for="fileds in reportData.dayCheckList[index]">{{fileds.inspectionResults}}</td>
          </tr>
          <tr>
            <td colspan="2">保养人</td>
            <td v-for="fileds in reportData.dayCheckList[0]">{{fileds.maintainer}}</td>
          </tr>
          <tr>
            <td colspan="2">稽查人</td>
            <td v-for="fileds in reportData.dayCheckList[0]">{{fileds.reviewer}}</td>
          </tr>
          <tr>
            <td colspan="33">备注：{{reportData.accountingMethod}} </td>
          </tr>
<!--          <tr>-->
<!--            <td colspan="13">备注：良好打√；不符合打 X;停机打；Ｏ </td>-->
<!--            <td colspan="10">保养人：</td>-->
<!--            <td colspan="10">稽查人：</td>-->
<!--          </tr>-->
        </table>
      </div>
    </a-card>
  </div>
</template>

<script>
export default {
  /** 日常点检记录表(烧录机、半自动分板机、全自动分板机) **/
  name: 'DailySpot',
  props:{
    reportData:{
      type:Object,
      default:()=>{}
    },
    type:{
      type:String,
      default:''
    }
  },
  data(){
    return {
      dayCheckList:[
        {
          checkName:'检查总电源是否正常',
          measure:'1'
        },
        {
          checkName:'检查各指示灯是否正常',
          measure:'2'
        },
      ],
    }
  }
}
</script>

<style scoped>

</style>